package Util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;


public class ConnectionUtil {

    private static Connection conn;

    public static Connection getConn() throws Exception {

        if (conn == null) {
            try {
                conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/glados", "root", "123456");
            } catch (SQLException ex) {
                throw new Exception("Erro ao conectar ao BD!", ex);
            }
        }
        return conn;
    }
}